<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="java.sql.Date"%>
<%@page import="sosr.bean.Patient"%>
<%@page import="base.Base"%>
<jsp:useBean id="pageConfig" scope="session" class="bean.Page"></jsp:useBean>
<%

request.setCharacterEncoding("UTF-8");

String action = request.getParameter("action");
String id_ = request.getParameter("id");
String idp_ = request.getParameter("idp");
String foract_ = request.getParameter("foract");
int id = -1;
if (id_!=null && !id_.isEmpty() && !id_.equals("undefined")) id = Integer.parseInt(id_); 
int idp = -1;
if (idp_!=null && !idp_.isEmpty() && !idp_.equals("undefined")) idp = Integer.parseInt(idp_);
if (foract_ == null) foract_ = "";

pageConfig.setAction_type(action);
pageConfig.setAction_id(id);
pageConfig.setPatient_id(idp);

if (action.equals("view")) {
	%>
	<jsp:include page="../pages/patient/viewPatientPage.jsp"></jsp:include>
	<%
}
else if (action.equals("delete")) {
	%>
	<jsp:include page="../pages/patient/deletePatientPage.jsp"></jsp:include>
	<%
}
else if (action.equals("refresh")) {
	if (foract_.equals("delete")) {
	%>
	<jsp:include page="../pages/patient/viewlist.jsp"></jsp:include>
	<%
	}
	else if (foract_.equals("drop_user")) {
	%>
	<jsp:include page="../pages/moncompte/viewlist.jsp"></jsp:include>
	<%
	} 
}
else if (action.equals("edit")) {
	%>
	<jsp:include page="../pages/patient/form_newpatient.jsp"></jsp:include>
	<%
}
else if (action.equals("add")) {
	%>
	<jsp:include page="../pages/patient/form_newpatient.jsp"></jsp:include>
	<%
}
else if (action.equals("add_ordo")) {
	%>
	<jsp:include page="../pages/ordonnance/form_newordonnance.jsp"></jsp:include>
	<%
}
else if (action.equals("view_ordo")) {
	%>
	<jsp:include page="../pages/ordonnance/viewordo.jsp"></jsp:include>
	<%
}
else if (action.equals("edit_infoperso")) {
	%>
	<jsp:include page="../pages/moncompte/form_modinfoperso.jsp"></jsp:include>
	<%
}
else if (action.equals("view_user")) {
	%>
	<jsp:include page="../pages/moncompte/viewUserPage.jsp"></jsp:include>
	<%
}
else if (action.equals("edit_user")) {
	%>
	<jsp:include page="../pages/moncompte/form_modacces.jsp"></jsp:include>
	<%
}
else if (action.equals("add_user")) {
	%>
	<jsp:include page="../pages/moncompte/form_modacces.jsp"></jsp:include>
	<%
}
else if (action.equals("drop_user")) {
	%>
	<jsp:include page="../pages/moncompte/deleteUserPage.jsp"></jsp:include>
	<%
}
%>